package com.hmall.config;

import com.hmall.client.ItemClient;
import com.hmall.client.UserClient;
import feign.Logger;
import feign.RequestInterceptor;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//defaultConfiguration 全局打印模式
@EnableFeignClients(defaultConfiguration = DefaultFeignConfiguration.class, basePackages = "com.hmall.client")
@Configuration
public class DefaultFeignConfiguration {
    @Bean
    public Logger.Level loggerLevel() {
        // 日志级别为BASIC，这是个枚举类型
        return Logger.Level.BASIC;
    }

    @Bean
    public RequestInterceptor requestInterceptor() {
        return new MyFeignInterceptor();
    }


}